using System;
using System.Collections.Generic;
using ProjectDanmaku.Avatar.Basic;
using ProjectDanmaku.Core;
using ProjectDanmaku.Entity;
using ProjectDanmaku.Level;
using ProjectDanmaku.UI;
using UnityEngine;
using UnityEngine.Serialization;

namespace ProjectDanmaku.Scenario
{
    public class DanmakuGameStatistics
    {
        public int PlayerJikiCount;
        public float GameTime;
        public bool PlayerLose;
    } 
    
    public class DanmakuScenario : MonoBehaviour
    {
        // 出于性能考虑，这里采用单对单碰撞检测模式
        public static AvatarBehavior CurrentAvatarBehavior;
        public static readonly List<ShootableObject> ShootableObjects = new List<ShootableObject>();

        public static DanmakuGameStatistics GameStatistics = new ();
        public static uint DisabledUnitFlags = 0;

        /// <summary>
        ///     Death Zone(x, y, radius, z >= 1 then enabled)
        /// </summary>
        public static Vector4 BulletDeathZone = Vector4.zero;
        
        public static ILevel CurrentLevel = null;
        
        public LevelManager levelManager;
        public AvatarController avatarController;
        
        public EntityLayer bulletEntityLayer;
        
        private void Awake()
        {
            GameStatistics = new DanmakuGameStatistics();
        }

        private void Update()
        {
            GameStatistics.GameTime += Time.deltaTime;
        }

        public static void SetBulletDeathZoneState(bool state)
        {
            BulletDeathZone.w = state ? 1 : 0;
        }
    }
}
